<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!----成绩转换 100 转换为五分制 -->
    请输入你的成绩：<input type="text" id="score">
    <input type="button" value="转换" id="trans">
    <input type="text" id="result">
    <script>
        var transObj=document.getElementById("trans");
        var scoreObj=document.getElementById("score");
        var resultObj=document.getElementById("result");
        transObj.onclick=function(){
            var score=parseInt(scoreObj.value);
            score=Math.floor(score/10);
            switch(score){
                case 10:
                case 9:
                    resultObj.value="A等级"
                    break;
                    case 8:
                        resultObj.value="B等级"
                        break;
                    case 7:
                        resultObj.value="C等级"
                        break;
                    case 6:
                        resultObj.value="D等级"
                        break;
                 default:
                        resultObj.value="E等级"
                        break;10
 } 
}
    </script>

</body>
</html>